package com.itheima.collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Demo02 {

    public static void main(String[] args) {
        Collection<String> list= new ArrayList<>();
        list.add("蔡徐坤");
        list.add("蔡徐坤");
        list.add("黄子韬");
        list.add("鹿晗");
        Iterator<String> iterator = list.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());

        }
    }
}
